package com.snork.tribanspeedo;


public class Globals {
	private static Globals instance;

       //Global variable
	   private double totalDist = 0;
	   private double prevLat = 0;
	   private double prevLong = 0;
	 
	   // Restrict the constructor from being instantiated
	   private Globals(){}
	 
	   public void setCoords(double newLat, double newLong)
	   {
		   this.prevLat = newLat;
		   this.prevLong = newLong;
	   }
	   
	   public double getLat()
	   {
		   return this.prevLat;
	   }

	   public double getLong()
           {
		   return this.prevLong;
	   }

	   public void setTotalDist(double dist){
	     this.totalDist = totalDist + dist;
	   }
	   
  
	   public double getTotalDist(){
	     return this.totalDist;
	   }
	 
	   public static synchronized Globals getInstance(){
	     if(instance==null){
	       instance=new Globals();
	     }
	     return instance;
	   }
	   
}